package cn.math.appmath.bean;

public class PageBean {
	public static int countTotalPage(int pageSize, int allRow){
		int totalPage;
		if(allRow%pageSize == 0){
			totalPage = allRow/pageSize;
		}else{
			totalPage = new Integer(allRow/pageSize) +1;
		}
		return totalPage;
	}
	
	public static int countCurrentPage(int page){
		if(page<0){
			page = page + 2;
		}else{
			page++;
		}
		return page;
	}
	
	public static int countCurrentRow(int pageSize, int currentPgae){
		currentPgae--;
		return currentPgae*pageSize;
	}
}
